package rkdwogus7;

import java.util.*;

public class Practice_temp {

	public static void main(String[] args) {
		int year;
		Scanner sc = null;
		sc = new Scanner(System.in);
		
		System.out.println("enter year");
		year = sc.nextInt();
		
		int a=
		((((year-1)*365 + (year - 1)/4 - (year - 1)/100 + (year -1)/400)%7) + 1);

		System.out.println( a );
	}

}
